local Lua__bingxin = fk.CreateSkill {

  name = "Lua__bingxin",

}

Fk:loadTranslationTable {
  ["Lua__bingxin"] = "冰心",
  ["$Lua__bingxin1"] = "千身影绝，万籁俱灭。",
  ["$Lua__bingxin2"] = "风尽久功名，弦发鸟兽散。",
  ["$Lua__bingxin3"] = "六合萧条，万尽踪灭。",
  ["$Lua__bingxin4"] = "寒冬将至，该是雪花绽放的时候了。",
  [":Lua__bingxin"] = "当你被牌指定时，你可回复一点体力并取消所有目标。其他角色回合开始时，其可以受到你造成的一点冰属性伤害，令你本回合不能发动此技能。",
  ["#bingxin-invoke"] = "冰心：你可以受到 %src 造成的一点冰属性伤害，令其本回合不能发动“冰心”。",
  ["@@bingxin_banned-turn"] = "冰心不能发动",

}

Lua__bingxin:addEffect(fk.TargetSpecified, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if not player:hasSkill(Lua__bingxin.name) then return false end
    return data.to == player and player:getMark("@@bingxin_banned-turn") == 0
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    return player.room:askToSkillInvoke(player, { skill_name = Lua__bingxin.name, })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:recover({
      who = player,
      num = 1,
      recoverBy = player,
      skillName = Lua__bingxin.name
    })
    for i = #data.use.tos, 1, -1 do
      data:cancelTarget(data.use.tos[i])
    end
  end,
})
Lua__bingxin:addEffect(fk.TurnStart, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    if not player:hasSkill(Lua__bingxin.name) then return false end
    return target ~= player
  end,
  on_cost = function(self, event, target, player, data)
    local room = player.room
    return player.room:askToSkillInvoke(target, { skill_name = Lua__bingxin.name, prompt = "#bingxin-invoke:" ..
    player.id })
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:damage({
      from = player,
      to = target,
      damage = 1,
      damageType = fk.IceDamage,
      skillName = Lua__bingxin.name
    })
    -- 禁止本回合使用冰心
    room:setPlayerMark(player, "@@bingxin_banned-turn", 1)
  end,
})

return Lua__bingxin
